-
Notifications
You must be signed in to change notification settings - Fork 245
feat(data-modeling): show collection name / relationship label in drawer header; show item associated actions in header COMPASS-9653 #7176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…awer header; show item associated actions in header
| // TODO(ticket): This is obviously a horrible selector and we should make sure | ||
| // that LG team provides a better one for us to achieve this behavior when | ||
| // we're removing the vendored version of the drawer | ||
| '& > div:nth-child(2) > div:nth-child(2) > div:first-child > div:first-child > div:first-child > div:first-child': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So a slightly less hacky version of this that I had initially was div:has(>strong), but our version of jsdom can't handle it and I didn't want to include version bump in this PR, but I'll revisit this after
| // layout the controls there better. Doing our best to target the section | ||
| // title here, leafygreen really doesn't give us anything else to try. | ||
| // | ||
| // TODO(ticket): This is obviously a horrible selector and we should make sure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hoping to get a ticket number from this Slack thread
| const { id } = getActiveDrawerContent() || {}; | ||
| const lgIds = getLgIds(dataLgId); | ||
| const hasData = toolbarData && toolbarData.length > 0; | ||
| const { title, content } = | ||
| toolbarData.find((data) => { | ||
| return data.id === id; | ||
| }) ?? {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is like a super minimal version of the fix that LG team did in this patch, mapping their changes on top of our vendored package was tricky due to naming (and seems like code was generally shifted around more there), but we can be sure that when this is not vendored anymore, this will continue working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I promised a test for this, let me add that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 1538798
paula-stacho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! The title is actually a good idea, could we add it to the relationship items as well?
This patch changes the drawer title behavior in data-modeling to show a more specific label and also moves some drawer item related controls to the heading section. For now it's just one item that we show for relationships, but this will be expanded in the future, so I already tried to account for that